home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7997 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. Path: anvil.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Checking For Keyboard Input
  5. Date: 28 Feb 1996 12:41:31 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4h2elrINNp0k@anvil.ugrad.cs.ubc.ca>
  8. References: <cerebus.34.000DD98A@voicenet.com> <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca> <1176@altheim.win-uk.net>
  9. NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
  10.  
  11. In article <1176@altheim.win-uk.net>,
  12. Brian R. Oldham <broldham@altheim.win-uk.net> wrote:
  13. >In article <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca>, Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) writes:
  14. >>In article <cerebus.34.000DD98A@voicenet.com>,
  15. >>aLEX <cerebus@voicenet.com> wrote:
  16. >>>Hello fellow C programmers,
  17. >>
  18. >>That's a little presumptious, don't you think?
  19. >>
  20. >
  21. >Also of you to say so, Kazi.
  22. >
  23. >>>        Is there anyway to check if keyboard input has been entered without 
  24. >>>actually stalling the excution of the code until the user presses a key.  I 
  25. >>>would really like to do this but I can't seem to find any way.  If you know of 
  26. >>>a way PLEASE email me or post it.  Thank you in advance.
  27. >>
  28. >>This question comes up not fewer than 10 times a week in this newsgroup, yet it
  29. >>has nothing to do with the C language. It is more than adequatly covered in the
  30. >>FAQ, as you would know if you had read it.
  31. >>-- 
  32. >
  33. >If you had not been so preoccupied with your annoyance at aLEX's
  34. >greeting you might have answered his query - or ignored it. A simple
  35.  
  36. I wasn't annoyed with the greeting at all. 
  37.  
  38. >brief mention of kbhit() or equivalent, or a call to whatever interrupt
  39.  
  40. kbhit() is not a standard function. Are you advocating that we give incorrect
  41. answers on comp.lang.c? I don't know what ``whatever interrupt'' is, nor should
  42. I have to. What makes you sure that kbhit() is available in aLEX's programming
  43. environment? He could easily be using UNIX, which is likely, since the method
  44. for doing such a check is somewhat more occluded from common knowledge than
  45. under DOS.  Anyone who knows how to read can readily discover the answer from
  46. their (legitimately purchased) compiler's manual on this platform. Just look up
  47. "keyboard" in the index of your MS, Borland, Watcom or Symantec documentation
  48. and you will likely find a reference to kbhit() in no time.
  49.  
  50. >pauses the keyboard would have been helpful, but you may be assured,
  51. >none of us appreciate supercilious resposes such as this. Are you going
  52. >to post this crap *every* time a newbie asks a question?
  53.  
  54. Nope! I think I have pretty much kicked the habit already.
  55.  
  56. Nevertheless, the fact is, whether or not there is a way to access keyboard
  57. buffers in C, the question _is_ answered in the FAQ. Even "Internet for
  58. Dummies" kinds of books clearly tell you where you can get Usenet FAQ's when
  59. they don't appear in the actual newsgroup. The response may have been
  60. supercilious, but pointing the FAQ is a lot more proper than what you suggest.
  61. I should have done so in an e-mail message, course, and for not doing so I must
  62. apologize.
  63.  
  64. If the poster had followed read _any_ of the newsgroup _at all_ for even a day
  65. or two, he could have come across a thread that already discusses this. A
  66. simple subject search for "keyboard" will probably dig up some back articles
  67. (assuming the poster's NNTP server keeps a few). Proper netiquette says that
  68. you follow a newsgroup a little bit before adding articles, and read some
  69. FAQ's.
  70.  
  71. You are absolutely right that responding to such posts publicly only
  72. multiplies the spam.
  73. -- 
  74.  
  75.